<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2019/1/21
  Time: 18:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>修改前的回显</title>
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css">
    <script language="javascript" type="text/javascript" src="/My97DatePicker/WdatePicker.js"></script>
    <script src="/layuiadmin/layui/layui.js" charset="utf-8"></script>
</head>
<body>

<style type="text/css">
    .layui-form-item{
        margin-left: 20px;
        margin-top: 20px;
        width:500px;
    }
</style>
<form id="myform" class="layui-form" action="/updateCom" lay-filter="example" method="post">

    <input type="hidden" id="ctId" name="ctId" value="${cl.ctId}">

    <div class="layui-form-item">
        <label class="layui-form-label">会员id</label>
        <div class="layui-input-block">
            <input type="text" id="uId" name="uId" lay-verify="title" autocomplete="off" value="${cl.UId}" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">商品id</label>
        <div class="layui-input-block">
            <input type="text" id="wareId" name="wareId" lay-verify="title" autocomplete="off" value="${cl.wareId}" class="layui-input">
        </div>
    </div>

</form>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button class="layui-btn" lay-submit="" lay-filter="demo1" onclick="sub()">提交</button>
    </div>
</div>

<script>
   function s(id) {
        var str=document.getElementById("wareId").value;
        if(""==str){
            str+=id;
        }else{
            str+=","+id;
        }
        document.getElementById("wareId").value=str;
    }

    function sub() {
      //  var ctId = document.getElementById("ctId").value;
        var uId = document.getElementById("uId").value;
        var wareId = document.getElementById("wareId").value;
        alert(123);
     //   var uNickName = document.getElementById("uNickName").value;
        // var numreg = /^[0-9]*$/;
             if ("" == uId) {
            alert("会员id未填写");
            return false;

            if ("" == wareId) {
                alert("商品集合未填写");
                return false;
            }
            var index = parent.layer.getFrameIndex(window.name);
            document.getElementById("myform").submit();
            //关闭窗口
            parent.layer.close(index);
        }
    }
</script>
</body>
</html>
